<!DOCTYPE>
<html>
<head>
<!-- 浏览器中显示自己的图表-->
<link rel="icon" href="../img/coco.png" type="image/x-icon" />
<link rel="shortcut icon" href="../img/coco.png" type="image/x-icon" />
<title>vue.js demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="vue.js学习" />
<script src="https://cdn.bootcss.com/vue/2.4.2/vue.min.js"></script>
</head>
    <body>
        <div>
            <audio controls autoplay="autopaly">
                <source src="renxi.mp3" type="audio/mp3" />
            </audio>
        </div>
    	<div id="app">
            <p>{{ site }}</p>
        </div>

      <script>
        var vm = new Vue({
          el:'#app',
          data:{
            name:'Google',
              url:'http://www.baidu.com'
          },
            computed:{
              site:{
                  //getter
                  get:function(){
                      return this.name + ' ' + this.url
                  },
                  //setter
                  set:function(newValue){
                      var names = newValue.split(' ')
                      this.name=names[0]
                      this.url = names[names.length - 1]
                  }
              }
            }
        })
        vm.site = '菜鸟教程 http://www.baidu.com';
        document.write('name ' + vm.name);
        document.write('<br>');
        document.write('url: ' + vm.url);
      </script>
    </body>
</html>
